# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyric
pkgname=('python2-pyric' 'python-pyric')
_pkgname=PyRIC
pkgver=184.bc0dce3
pkgrel=7
pkgdesc='Python Radio Interface Controller Linux wireless library for the Python Wireless Developer and Pentester.'
arch=('any')
url='https://pypi.org/project/pyric/#files'
license=('GPL3')
makedepends=('git' 'python2-setuptools' 'python-setuptools')
source=("git+https://github.com/sophron/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cp -a "$_pkgname"{,-2}
}

build() {
  cd "$_pkgname-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname"

  python setup.py build
}

package_python2-pyric() {
  depends=('python2')

  cd "$_pkgname-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pyric() {
  depends=('python')

  cd $_pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

